﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Comm
{
    /// <summary>
    /// MD5加密类
    /// </summary>
    public class MD5
    {
        private static int _num = 24; //默认位数
        /// <summary>
        /// MD5加密
        /// </summary>
        /// <param name="pToEncrypt">需加密字符串</param>
        /// <param name="num">位数</param>
        /// <returns>加密后字符串</returns>
        public static string EncryptMD5(string pToEncrypt, int num)
        {
            return "";
        }

        /// <summary>
        /// MD5加密
        /// </summary>
        /// <param name="pToEncrypt">需加密字符串</param>
        /// <returns>加密后字符串</returns>
        public static string EncryptMD5(string pToEncrypt)
        {
            return EncryptMD5(pToEncrypt, _num);
        }

        /// <summary>
        /// MD5解密
        /// </summary>
        /// <param name="pToDecrypt">需解密字符串</param>
        /// <param name="num">位数</param>
        /// <returns>解密后字符串</returns>
        public static string DecryptMD5(string pToDecrypt, int num)
        {
            return "";
        }

        /// <summary>
        /// MD5解密
        /// </summary>
        /// <param name="pToDecrypt">需解密字符串</param>
        /// <returns>解密后字符串</returns>
        public static string DecryptMD5(string pToDecrypt)
        {
            return DecryptMD5(pToDecrypt, _num);
        }
    }
}
